# --------------------------------
# -*- coding: utf-8 -*-
# Author: Zhu
# Date: 2021/12/21   
# Description:作业端-B2B流程的页面元素
# --------------------------------
from selenium.webdriver.common.by import By

class ele_B2B_PROCESS:
    '''
    作业端-B2B流程的页面元素
    1、退货入库订单
    2、收货入库
    3、纸单上架
    4、退厂出库订单
    5、B2B订单处理
    6、B2B纸单拣货
    7、B2B订单复核
    8、B2B交接发货
    '''

#------------------------------------------------------------------------- 1、退货入库订单---------------------------------
    # 退货入库订单
    ys01_RefundOrder = By.XPATH , '/html/body/div[1]/div/div[1]/div[2]/div[1]/div/ul/div[4]/li/ul/div[2]/a/li/span'

    # 新建B2B退单
    ys01_Create_B2BRefund = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[1]/button[2]/span'

    # 输入框-- WB_ReturnGoods_Number,Logistics_Company,Logistice_ONumber,ReturnGoods_Reason,Remark,Goods_quantity
    # 外部退货单号
    ys01_WB_ReturnGoods_Number = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[3]' \
                                          '/div/div/div/input'

    # 物流公司
    ys01_Logistics_Company = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[4]/div' \
                                      '/div/div/input'

    # 物流单号
    ys01_Logistice_ONumber = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[1]/div' \
                                     '/div/div/input'

    # 退货原因
    ys01_ReturnGoods_Reason = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[2]/div' \
                                       '/div/div/input'

    # 备注
    ys01_Remark = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[3]/div/div/div/input'

    # 下拉列表
    # 货主名称
    ys01_Shipper = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[1]/div/div/div/div/input'
    ys01_Shipper2 = By.XPATH , '/html/body/div[last()]/div[1]/div[1]/ul/li[3]/span'

    # 退货客户
    ys01_ReturnGoods_Customer = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[2]' \
                                         '/div/div/div/div[1]/input'
    ys01_ReturnGoods_Customer2 = By.XPATH , "//span[contains(text(),'岛的故事')]"

    # 添加商品
    ys01_AddGoods = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[1]/button[1]/span'

    # 商品名称
    ys01_Goods_Name = By.XPATH , '/html/body/div[5]/div/div[2]/div/form/div[1]/div/div/div/div[1]/input'
    ys01_Goods_Name2 = By.XPATH , '/html/body/div[last()]/div[1]/div[1]/ul/li[3]/span'

    # 商品数量，下面的地址商品栏的地址
    # ys_Goods_quantity = By.XPATH , '/html/body/div[5]/div/div[2]/div/form/div[4]/div/div/div/div/input'
    ys01_Goods_quantity = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[2]/div/div[2]' \
                                   '/div[1]/div[2]/table/tbody/tr/td[8]/div/div/div/input'

    # 保存并添下一条
    ys01_SaveGoods_Btn = By.XPATH , '/html/body/div[5]/div/div[3]/span/button[2]/span'

    # 关闭添加商品按钮
    ys01_CloseGoods_Btn = By.XPATH , '/html/body/div[5]/div/div[1]/button/i'

    # 保存B2B退货入库订单页面
    ys01_SaveOrder_Btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[2]/button[2]/span'

    # 选择 退货入库页面列表第一条数据
    ys01_Click_ListOne = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]/' \
                             'div[2]/table/tbody/tr/td[1]/div/span/span[2]'

    # 审核 退货入库页面列表第一条数据
    ys01_Verify_ListOne = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[1]/button[3]/span'

    ys01_Verify_ListOne2 = By.XPATH , '/html/body/div[last()]/div/div[3]/span/button[2]/span'


#--------------------------------------------------------------------------- 2、收货入库----------------------------------

    # 搜索条件--货主名称
    ys02_Search_Shipper = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[2]/div/div/div/div[1]/input'
    # 搜索条件--货主名称--UI货主
    ys02_Search_Shipper2 = By.XPATH , '/html/body/div[last()]/div[1]/div[1]/ul/li[3]/span'

    # 搜索按钮
    ys02_Search_Btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[12]/button[1]'


    # 收货入库
    ys02_Receipt_Goods = By.XPATH , '/html/body/div[1]/div/div[1]/div[2]/div[1]/div/ul/div[5]/li/ul/div[1]/a/li/span'

    # 验收第一条数据
    ys02_Receipt_GoodsList_One = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/' \
                                          'div[2]/div[2]/div[2]/table/tbody/tr[1]/td/div/div/button/span/i'

    # 标准验收页面，第一条数据的勾选框
    ys02_Receipt_GoodsList2_One = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[2]/div/' \
                                           'div[2]/div[1]/div[2]/table/tbody/tr/td[1]/div/span/span[2]'

    # 本次验收按钮
    ys02_Standard_Acceptance = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[1]/button[1]/span'



#--------------------------------------------------------------------------- 3、纸单上架----------------------------------
    # Shelf_Location , Shelf_Quantity

    # 搜索条件--货主名称
    ys03_Search_Shipper = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[2]/div/div/div/div/input'
    # 搜索条件--货主名称--UI货主
    ys03_Search_Shipper2 = By.XPATH , '/html/body/div[last()]/div[1]/div[1]/ul/li[3]/span'

    # 搜索按钮
    ys03_Search_Btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/form/div/div[9]/button[1]/span'

    # 纸单上架
    ys03_Paper_Shelf = By.XPATH , '/html/body/div[1]/div/div[1]/div[2]/div[1]/div/ul/div[5]/li/ul/div[2]/a/li/span'

    # 上架按钮
    ys03_Shelf_Btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[2]/div/div/div[2]/div[1]/div[2]/' \
                              'table/tbody/tr/td[14]/div/div/button[1]/span/i'

    # 实际上架库位
    ys03_Shelf_Location = By.XPATH , '/html/body/div[last()]/div/div[2]/div[2]/div[2]/div[1]/div[2]/table/tbody/tr/' \
                                   'td[9]/div/span/div/input'

    # 实际上架数量
    ys03_Shelf_Quantity = By.XPATH , '/html/body/div[last()]/div/div[2]/div[2]/div[2]/div[1]/div[2]/table/tbody/' \
                                   'tr/td[12]/div/span/div/div/input'

    # 上架确认按钮
    ys03_Shelf_Submit = By.XPATH , '/html/body/div[last()]/div/div[3]/span/button[2]/span'



#--------------------------------------------------------------------------- 4、退厂出库订单--------------------------------


    # 退厂出库订单
    ys04_RDelivery_Order = By.XPATH , '/html/body/div[1]/div/div[1]/div[2]/div[1]/div/ul/div[4]/li/ul/div[5]/a/li/span'

    #创建退厂出库订单按钮
    ys04_Create_RDelivery_Order = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div[1]/button[1]/span'

    # 下拉列表：货主名称、供应商、承运商
    # 货主名称
    ys04_Shipper = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[3]/div/div/div/div/input'
    ys04_Shipper2 = By.XPATH , '/html/body/div[last()]/div[1]/div[1]/ul/li[3]/span'

    # 供应商
    ys04_Supplie = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[4]/div/div/div/div/input'
    ys04_Supplie2 = By.XPATH , "//span[contains(text(),'漠河舞厅')]"

    # 承运商
    ys04_Carrier = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[1]/div/div/div[1]/div/input'
    ys04_Carrier2 = By.XPATH , "//span[contains(text(),'福寿多多')]"

    # 添加商品按钮
    ys04_AddGoods_btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[1]/button[1]/span'

    # 添加商品页面--列表第一条数据
    ys04_AddGoods_ListOne = By.XPATH , '/html/body/div[last()]/div/div[2]/div[2]/div[1]/div/div[2]/div[1]/div[2]/table' \
                                       '/tbody/tr/td[1]/div/span/span[2]'

    # 添加商品页面--添加按钮
    ys04_AddGoods_Add = By.XPATH , '/html/body/div[last()]/div/div[3]/span/button[2]'

    # 添加商品页面--关闭按钮
    ys04_AddGoods_close = By.XPATH , '/html/body/div[last()]/div/div[3]/span/button[1]/span'

    # 输入框：外部订单号、收货人、收货人手机、收货地址、订单备注、订单数量
    # OutOrderN , Consignee , Consignee_Phone , Address , Remark , Order_GoodsQuantity
    # 输入框：外部订单号
    ys04_OutOrderN = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[1]/div[1]/div/div/div/input'

    # 输入框：收货人
    ys04_Consignee = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[2]/div/div/div/input'

    # 输入框：收货人手机
    ys04_Consignee_Phone = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[2]/div[3]/div/' \
                                      'div/div/input'

    # 输入框：收货地址
    ys04_Address = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[3]/div[1]/div/div/div/input'

    # 输入框：订单备注
    ys04_Remark = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[1]/div/div/form/div[3]/div[2]/div/div/div/input'

    # 输入框：订单数量
    ys04_Order_GoodsQuantity = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[1]/div[2]/div/' \
                                          'div[2]/div[1]/div[2]/table/tbody/tr/td[10]/div/div/div/input'
    # 保存按钮
    ys04_Submit_Btn = By.XPATH , '/html/body/div[1]/div/div[2]/section/div/div[2]/div/div[2]/button[2]/span'





#--------------------------------------------------------------------------- 5、B2B订单处理--------------------------------


#--------------------------------------------------------------------------- 6、B2B纸单拣货--------------------------------


#--------------------------------------------------------------------------- 7、B2B订单复核--------------------------------


#--------------------------------------------------------------------------- 8、B2B交接发货--------------------------------

